package com.yohann.designPattern.observer.observer;

/**
 * <p>
 * 当前状态
 * </p>
 *
 * @author Yohann
 * @since 2021/2/12 17:06
 */
public class CurrentCondition implements Observer{
    private float temperature;
    private float pressure;
    private float humidity;

    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        System.out.println(toString());
    }

    @Override
    public String toString() {
        return "CurrentCondition{" +
                "temperature=" + temperature +
                ", pressure=" + pressure +
                ", humidity=" + humidity +
                '}';
    }
}